
ticketHub.controller('PNRMessCtrls',function($scope,$http){	
	$scope.show = false;
	$scope.postData = {			
			 "system": "TRAVELSKY_ICS", 
			 "PNR": ""
	};
	$scope.query = function(){	
		for(i in $scope.postData){
			if($scope.postData[i]==""){
				layer.msg("搜索条件不能为空");
				return false;
			}
		}
		layer.load(3,{shadeClose:true});//加载层；
		$http({
			url:'../utility/parsePNR?temp='+Math.random(),
			method:'post',
			data:$scope.postData
		}).success(function(data,header,config,status){
			layer.closeAll();				
			if(data.status=="1001"){				
				$scope.show = true;
				$scope.data = data.data;	

			}else{
				layer.alert("查询失败，"+data.message)
			}
			//响应成功
		}).error(function(data,header,config,status){
			layer.closeAll();	
			layer.alert("请求失败，请检查网络连接")
			//处理响应失败
		});
	};
	$scope.zhengjianhao = function(passengers){
		console.log(passengers)
		if(passengers.pp&&passengers.ni){
			return passengers.pp+"/"+passengers.ni;
		}else if(passengers.pp){
			return passengers.pp;
		}else if(passengers.ni){
			return passengers.ni;
		}else{
			return "";
		}
	}
})
	
	
